<!-- 设置规格 -->
<template>
	<view class="container">
		<text class="title">设置规格</text>
		<view class="form">
			<view class="form-content">
				<view class="header">
					<text class="title">颜色</text>
					<button class="add-btn iconfont btn-transition-scale9">&#xe612;</button>
				</view>
				<view class="form-item">
					<view class="input-border border-1px">
						<input class="input" type="text" value="" placeholder-style="color: #999;" placeholder="请输入" />
					</view>
					<button class="remove-btn iconfont btn-transition-scale9">&#xe626;</button>
				</view>
				<view class="form-item">
					<view class="input-border border-1px">
						<input class="input" type="text" value="" placeholder-style="color: #999;" placeholder="请输入" />
					</view>
					<button class="remove-btn iconfont btn-transition-scale9">&#xe626;</button>
				</view>
				<view class="form-item">
					<view class="input-border border-1px">
						<input class="input" type="text" value="" placeholder-style="color: #999;" placeholder="请输入" />
					</view>
					<button class="remove-btn iconfont btn-transition-scale9">&#xe626;</button>
				</view>
			</view>
			<view class="form-content">
				<view class="header">
					<text class="title">重量</text>
					<button class="add-btn iconfont btn-transition-scale9">&#xe612;</button>
				</view>
				<view class="form-item">
					<view class="input-border border-1px">
						<input class="input" type="text" value="" placeholder-style="color: #999;" placeholder="请输入" />
					</view>
					<button class="remove-btn iconfont btn-transition-scale9">&#xe626;</button>
				</view>
				<view class="form-item">
					<view class="input-border border-1px">
						<input class="input" type="text" value="" placeholder-style="color: #999;" placeholder="请输入" />
					</view>
					<button class="remove-btn iconfont btn-transition-scale9">&#xe626;</button>
				</view>
				<view class="form-item">
					<view class="input-border border-1px">
						<input class="input" type="text" value="" placeholder-style="color: #999;" placeholder="请输入" />
					</view>
					<button class="remove-btn iconfont btn-transition-scale9">&#xe626;</button>
				</view>
			</view>
		</view>

		<button class="add-combo-btn btn-transition-scale95" @click="handleShowComboPanel()">添加规格属性</button>
	</view>

	<!-- 添加规格类型 -->
	<SelectComboPanel v-model:visible="isShowComboPanel"></SelectComboPanel>
</template>

<script setup>
	import { ref } from 'vue';
	import SelectComboPanel from './select-combo-panel.vue';

	const isShowComboPanel = ref(false);

	const handleShowComboPanel = () => {
		isShowComboPanel.value = true;
	}
</script>

<style lang="scss" scoped>
	.container {
		padding: 34rpx 25rpx 0;

		.title {
			font-weight: bold;
			font-size: 30rpx;
			color: #222222;
			line-height: 1.5;
			padding-left: 4rpx;
		}
	}

	.form {
		background-color: white;
		border-radius: 20rpx;
		padding: 0 20rpx 40rpx 24rpx;
		margin-top: 24rpx;

		&-content {
			&+.form-content {
				margin-top: 10rpx;
			}

			.header {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 30rpx 0;

				.title {
					font-weight: bold;
					font-size: 30rpx;
					color: #222222;
				}

				.add-btn {
					font-size: 40rpx;
					color: #FE3333;
					background-color: transparent;
				}
			}

			.form-item {
				display: flex;
				align-items: center;

				&+.form-item {
					margin-top: 20rpx;
				}

				.input-border {
					flex-grow: 1;

					&::after {
						border-radius: 20rpx;
					}

					.input {
						width: 100%;
						height: 90rpx;
						font-size: 28rpx;
						color: #222222;
						padding-left: 14rpx;
						border-radius: 10rpx;
					}
				}


				.remove-btn {
					font-size: 40rpx;
					color: #FE3333;
					background-color: transparent;
					margin-left: 20rpx;
				}
			}
		}
	}

	.add-combo-btn {
		width: 100%;
		height: 88rpx;
		font-weight: bold;
		font-size: 30rpx;
		color: #FE3333;
		text-align: center;
		line-height: 88rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
		margin-top: 32rpx;
	}
</style>